<?php
require_once 'pages/TMSListPage.inc';
/**
 * @author dkrasilnikov@gmail.com
 */

class TMSTreeViewPage extends TMSListPage {
	public $NodeIconType = 'folder';
	
	protected function fetchList(THttpRequest $request){
		$this->list = new TMSListIterator($this->Model->GetContents(null,false),$this);
	}
	
	public function __get($nm){
		switch ($nm){
			case 'CreateLink':return null;break;
			default:return parent::__get($nm);
		}
	}
	
	public function ItemCreateUrl(IItem $item){
		return $this->service->ItemCreateUrl($this->Model->ClassName(),array('id'=>$item->ItemId()));
	}
	
	public function ActionUrls(IItem $item){
		return array_merge(array(
			'Create'=>$this->ItemCreateUrl($item),
		),parent::ActionUrls($item));
	}
}